﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using DTO;
namespace BUS
{
    public class Nhacungcap_BUS
    {
        public List<Nhacungcap_DTO> LayDanhSachNCC()
        {
            Nhacungcap_DAO dao = new Nhacungcap_DAO();
            return dao.LayDanhSachNCC();
        }
        public int ThemNhaCungCap(Nhacungcap_DTO cnDTO)
        {
            Nhacungcap_DAO dao = new Nhacungcap_DAO();
            return dao.ThemNhaCungCap(cnDTO);
        }
        public int CapNhatNhaCungCap(Nhacungcap_DTO cnDTO)
        {
            Nhacungcap_DAO dao = new Nhacungcap_DAO();
            return dao.CapNhatNhaCungCap(cnDTO);
        }
        public int XoaNhaCungCap(string mancc)
        {
            Nhacungcap_DAO dao = new Nhacungcap_DAO();
            return dao.XoaNhaCungCap(mancc);
        }

        public List<Nhacungcap_DTO> LayDanhSachNCC_Ten(string hoten)
        {
            Nhacungcap_DAO dao = new Nhacungcap_DAO();
            return dao.LayDanhSachNCC_Ten(hoten);
        }
    }

    public class MatHang_BUS
    {
        public List<MatHang_DTO> LayDanhSachMatHang(string maHD, string loaimh)
        {
            MatHang_DAO dao = new MatHang_DAO();
            return dao.LayDanhSachMatHang(maHD, loaimh);
        }
        public int ChiTietMatHang(MatHang_DTO cnDTO, string loaimh)
        {
            MatHang_DAO dao = new MatHang_DAO();
            return dao.ChiTietMatHang(cnDTO, loaimh);
        }
        public List<MatHang_DTO> LayDanhSachMH()
        {
            MatHang_DAO dao = new MatHang_DAO();
            return dao.LayDanhSachMH();
        }
        public int NhapHang(MatHang_DTO mh)
        {
            MatHang_DAO dao = new MatHang_DAO();
            return dao.NhapHang(mh);
        }
        public int TraHang(MatHang_DTO mh)
        {
            MatHang_DAO dao = new MatHang_DAO();
            return dao.TraHang(mh);
        }
        public int XoaMatHang(string MaHang, string loaimh)
        {
            MatHang_DAO dao = new MatHang_DAO();
            return dao.XoaMatHang(MaHang, loaimh);
        }
    }

    public class HoaDonNhap_BUS
    {
        public List<HoaDonNhap_DTO> LayDanhSachHoaDon(int MaNCC)
        {
            HoaDonNhap_DAO dao = new HoaDonNhap_DAO();
            return dao.LayDanhSachHoaDon(MaNCC);
        }
        public List<HoaDonNhap_DTO> LayDSTheoMaHD(string MaHD)
        {
            HoaDonNhap_DAO dao = new HoaDonNhap_DAO();
            return dao.LayDSTheoMaHD(MaHD);
        }
        public List<HoaDonNhap_DTO> LayMaHDMoi()
        {
            HoaDonNhap_DAO dao = new HoaDonNhap_DAO();
            return dao.LayMaHDMoi();
        }
        public int LapHoaDon(HoaDonNhap_DTO cnDTO)
        {
            HoaDonNhap_DAO dao = new HoaDonNhap_DAO();
            return dao.LapHoaDon(cnDTO);
        }
        public int XoaHoaDonNhap(string MaHD)
        {
            HoaDonNhap_DAO dao = new HoaDonNhap_DAO();
            return dao.XoaHoaDonNhap(MaHD);
        }
        public int CapNhatHoaDonNhap(HoaDonNhap_DTO cnDTO)
        {
            HoaDonNhap_DAO dao = new HoaDonNhap_DAO();
            return dao.CapNhatHoaDonNhap(cnDTO);
        }
    }
    public class HoaDonTra_BUS
    {
        public List<HoaDonTra_DTO> LayDanhSachHoaDon(int MaNCC)
        {
            HoaDonTra_DAO dao = new HoaDonTra_DAO();
            return dao.LayDanhSachHoaDon(MaNCC);
        }
        public List<HoaDonTra_DTO> LayDSTheoMaHD(string MaHD)
        {
            HoaDonTra_DAO dao = new HoaDonTra_DAO();
            return dao.LayDSTheoMaHD(MaHD);
        }
        public List<HoaDonTra_DTO> LayMaHDMoi()
        {
            HoaDonTra_DAO dao = new HoaDonTra_DAO();
            return dao.LayMaHDMoi();
        }
        public int LapHoaDon(HoaDonTra_DTO cnDTO)
        {
            HoaDonTra_DAO dao = new HoaDonTra_DAO();
            return dao.LapHoaDon(cnDTO);
        }
        public int CapNhatHoaDonTra(HoaDonTra_DTO cnDTO)
        {
            HoaDonTra_DAO dao = new HoaDonTra_DAO();
            return dao.CapNhatHoaDonTra(cnDTO);
        }
        public int XoaHoaDonTra(string MaHD)
        {
            HoaDonTra_DAO dao = new HoaDonTra_DAO();
            return dao.XoaHoaDonTra(MaHD);
        }
    }


}
